import * as actionTypes from './constants'

const defaultState = {
    productList: []
}

const reducer = (state = defaultState, action) => {
    switch (action.type) {
        case actionTypes.ADD_PRODUCT:
            state.productList.push(action.data)
            return {...state}
        default:
            return state
    }
}

export default reducer